<%= javascript_include_tag :fckeditor %>
<h1>Editing News</h1>

<% form_for :news, @news ,:url => admin_news_page_path(@news.id), :html =>{:method => :put, :multipart => true} do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :meta_title %><br />
    <%= f.text_field :meta_title %>
  </p>
  <p>
    <%= f.label :meta_keyword %><br />
    <%= f.text_field :meta_keyword %>
  </p>
  <p>
    <%= f.label :meta_description %><br />
    <%= f.text_field :meta_description %>
  </p>
  <p>
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </p>
  <p>
    <%= f.label :body %><br />
    <%= fckeditor_textarea(:news,:body,:toolbarSet => 'Basic', :width => '100%', :height => '200px') %>
  </p>
  <p>
    <% if !@news.news_upload.nil? %>
      <%= image_tag(@news.news_upload.public_filename) %><br>
      <%= link_to "remove",{:action =>"remove",:with =>@news.news_upload.id}  %>
    <%else%>
      <% fields_for  :upload do |fd|%>
        <%= fd.file_field :uploaded_data %>
      <%end%>
    <%end%>
  </p>
  <p>
    <%= f.label :published %><br />
    <%= f.check_box :published %>
  </p>
  <p>
    <%= f.submit 'Update' %>
  </p>
<% end %>

<%= link_to 'Show', admin_news_page_path(@news.id) %> |
<%= link_to 'Back', admin_news_pages_path %>